package fem2.mesh_and_topology;

import fem2.Element;

public class IntegrationPointInfo implements SpatialInfo {

	private Element e;
	private int k;

	public IntegrationPointInfo(Element e, int k) {
		this.e = e;
		this.k = k;
	}

	@Override
	public double[] getPosition() {
		return e.getMeshPart().XAt(e.getIntegrationPoint(k));
	}

	public Element getElement() {
		return e;
	}

	public int getIpIndex() {
		return k;
	}

	@Override
	public String toString() {
		return "Element " + e.getId() + ", integration point " + k;
	}
}